/*
 * Copyright (C) 2009 Virgil Dobjanschi, Jeff Sharkey
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.example.googleio.provider;

import android.net.Uri;
import android.provider.BaseColumns;

public class SessionsContract {
    
    public static final String AUTHORITY = "com.example.googleio";
    
    public static interface BlocksColumns {
        /** Exact start time of session as UTC timestamp */
        public static final String TIME_START = "timestart";
        /** Exact end time of session as UTC timestamp */
        public static final String TIME_END = "timeend";
        
    }

    public static interface TracksColumns {
        /** Name of this track */
        public static final String TRACK = "track";
        /** Color of this track */
        public static final String COLOR = "color";
        /** Flag if this track is visible to user */
        public static final String VISIBLE = "visible";
        
    }
    
    public static interface SessionsColumns {
        /** {@link Tracks#_ID} this session belongs to */
        public static final String TRACK_ID = "track_id";
        /** {@link Blocks#_ID} this session belongs to */
        public static final String BLOCK_ID = "block_id";
        
        /** Title of this session */
        public static final String TITLE = "title";
        /** List of all speakers for this session */
        public static final String SPEAKER_NAMES = "speaker_names";
        /** Body text of session abstract */
        public static final String ABSTRACT = "abstract";
        /** Name of room this session takes place in */
        public static final String ROOM = "room";
        
        /** Type of session, such as its technical level */
        public static final String TYPE = "type";
        /** Tags or keywords associated with this session */
        public static final String TAGS = "tags";

        /** Link to online details about this session */
        public static final String LINK = "link";
        /** Link to alternate details, such as a Moderator page */
        public static final String LINK_ALT = "linkalt";

        /** Flag if this session has been starred by user */
        public static final String STARRED = "starred";
        
    }
    
    public static interface SearchColumns {
        /** Text to be used when building search index */
        public static final String INDEX_TEXT = "indextext";
        /** Snippet text that was matched by a search */
        public static final String SNIPPET = "snippet";
        /** {@link SessionColumns#_ID} that this search entry belongs to */
        public static final String SESSION_ID = "session_id";
        
    }
    
    public static interface SuggestColumns {
        /** Suggestion text to present user */
        public static final String DISPLAY1 = "display1";
        
    }
    
    
    public static class Blocks implements BaseColumns, BlocksColumns {
        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/blocks/");
        
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/com.example.googleio.block";
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/com.example.googleio.block";
        
    }

    public static class Tracks implements BaseColumns, TracksColumns {
        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/tracks/");
        public static final Uri CONTENT_VISIBLE_URI = Uri.withAppendedPath(CONTENT_URI, "visible");
        
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/com.example.googleio.track";
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/com.example.googleio.track";
        
    }
    
    public static class Sessions implements BaseColumns, SessionsColumns {
        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/sessions/");
        public static final Uri CONTENT_SEARCH_URI = Uri.parse("content://" + AUTHORITY + "/sessions/search/");

        /** The directory twig for session sub-tables */
        public static final String CONTENT_DIRECTORY = "sessions";
        
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/com.example.googleio.session";
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/com.example.googleio.session";
        
    }
    
    
    public static class Suggest implements BaseColumns, SuggestColumns {
        /** Search keyword suggestions */
        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/search_suggest_query/");
        
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/suggestion";
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/suggestion";
        
    }
}
